package com.gitee.wsl.transform.encode.pinyin.trie.handler

import com.gitee.wsl.transform.encode.pinyin.trie.Emit
import com.gitee.wsl.transform.encode.pinyin.trie.PayloadEmit

/**
 * Convenience wrapper class that delegates every method to an
 * instance of [EmitHandler].
 */
class PayloadEmitDelegateHandler(private val handler: EmitHandler) : PayloadEmitHandler<String> {
    override fun emit(emit: PayloadEmit<String>): Boolean {
        val newEmit = Emit(emit.start, emit.end, emit.keyword)
        return handler.emit(newEmit)
    }
}
